<?php
/**
 * This is the main include file of the Beluga-Framework.
 *
 * The framework is only really usable if you include first this file!
 *
 * All required core files of the framework are included inside this file (all from the ./Core subfolder.
 *
 * - <b>Core/ExceptionBase.class.php</b>: Internal class {@see \BF\ExceptionBase}
 * - <b>Core/PhpException.class.php</b>: Class {@see \BF\PhpException}
 * - <b>Core/Exception.class.php</b>: Class {@see \BF\Exception}
 * - <b>Core/LocaleConfig.class.php</b>: Class {@see \BF\LocaleConfig}
 * - <b>Core/LocalHelper.class.php</b>: Class {@see \BF\LocaleHelper}
 * - <b>Core/Locale.class.php</b>: Class {@see \BF\Locale}
 * - <b>Core/TranslatorConfig.class.php</b>: Class {@see \BF\TranslatorConfig}
 * - <b>Core/Translator.class.php</b>: Class {@see \BF\Translator}
 * - <b>Core/FrameworkConfig.class.php</b>: Class {@see \BF\FrameworkConfig}
 * - <b>Core/errorhandler.php</b>: Framework internal error handler
 * - <b>Core/ExplicitGetter.class.php</b> Class {@see \BF\ExplicitGetter}
 * - <b>Core/ExplicitGetterSetter.class.php</b> Class {@see \BF\ExplicitGetterSetter}
 * - <b>Core/global.constants.php</b>: Framework wide global constants
 * - <b>Core/global.functions.php</b>: Some string functions and the native framework autoloader
 *
 * @author   Kado <ulfikado@gmail.com>
 * @category Beluga PHP5.3+ Framework
 * @package  BF\Core
 * @since    2015-01-17 14:29
 * @version  0.1
 */

namespace
{

   # <editor-fold defaultstate="collapsed" desc="Function unixizePath">

   /**
    * @ignore
    * @internal
    */
   function unixizePath( $path, $endsWithSeparator=null )
   {
      if (\is_null($endsWithSeparator) )
      {
         return \str_replace( '\\', '/', $path );
      }
      return \rtrim( \str_replace( '\\', '/', $path ), '/' ) . ( $endsWithSeparator ? '/' : '');
   }

   # </editor-fold>

   if ( ! \function_exists( '\\mb_strlen' ) )
   {

      // Without the multibyte extension the Beluga will not work!
      die( 'Beluga framework error. The required Multibyte PHP extension is not loaded!' );

   }

   # <editor-fold defaultstate="collapsed" desc="I N C L U D E   C O R E">

   include __DIR__ . '/Core/global.constants.php';
   include __DIR__ . '/Core/global.functions.php';
   include __DIR__ . '/Core/ExceptionBase.class.php';
   include __DIR__ . '/Core/PhpException.class.php';
   include __DIR__ . '/Core/Exception.class.php';
   include __DIR__ . '/Core/errorhandler.php';
   include __DIR__ . '/Core/ExplicitGetter.class.php';
   include __DIR__ . '/Core/ExplicitGetterSetter.class.php';
   include __DIR__ . '/Core/LocaleConfig.class.php';
   include __DIR__ . '/Core/TranslatorConfig.class.php';
   include __DIR__ . '/Core/FrameworkConfig.class.php';
   include __DIR__ . '/Core/Locale.class.php';
   include __DIR__ . '/Core/Translator.class.php';

   # </editor-fold>

   \BF\Translator::GetInstance()->addTranslationFolder( \BF_FOLDER . '/.translations' );

}

